<?php
$rutaArchivo = "files" . "/" . $codigo;
?>
<h1>Resoluciones modificatorias <?php echo $codigo; ?></h1>
<div class="paging">
    <?php
    echo $this->Paginator->options(array('update' => '#content', 'evalScripts' => false));
    echo $this->Paginator->prev('< ' . __('Anterior'), array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('Siguiente') . ' >', array(), null, array('class' => 'next disabled'));
    ?>
</div>
<table id="tabla">
    <thead>
        <tr>
            <th><?php echo $this->Paginator->sort('Id', 'ResolutionCorrection.id'); ?></th>
            <th><?php echo $this->Paginator->sort('Observación', 'ResolutionCorrection.observacion'); ?></th>
            <th><?php echo $this->Paginator->sort('Número resolución', 'ResolutionCorrection.numero'); ?></th>
            <th><?php echo $this->Paginator->sort('Fecha', 'ResolutionCorrection.fecha'); ?></th>
            <th></th>
            <th></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($ResolutionCorrections as $ResolutionCorrection): ?>
            <tr>

                <td><?php echo $ResolutionCorrection['ResolutionCorrection']['id']; ?></td>
                <td><?php echo $ResolutionCorrection['ResolutionCorrection']['observacion']; ?></td>
                <td><?php echo $ResolutionCorrection['ResolutionCorrection']['numero']; ?></td>
                <td><?php echo $ResolutionCorrection['ResolutionCorrection']['fecha']; ?></td>
                <td>
                    <?php if (file_exists("files/$codigo/resoluciones_modificatorias/" . $ResolutionCorrection['ResolutionCorrection']['archivo'])):?>
                        <a href="<?php echo "files/$codigo/resoluciones_modificatorias/" . $ResolutionCorrection['ResolutionCorrection']['archivo'] ?>" target="blank" class="actions" >Adjunto</a>

                   <?php endif; ?>

                </td>
                <td><?php echo $this->Ajax->link('Editar', array('controller' => 'ResolutionCorrections', 'action' => 'edit', $ResolutionCorrection["ResolutionCorrection"]["id"]), array('update' => 'content', 'indicator' => 'loading','class'=>'actions')); ?></td>
                <td><?php echo $this->Ajax->link('Eliminar', array('controller' => 'ResolutionCorrections', 'action' => 'delete', $ResolutionCorrection["ResolutionCorrection"]["id"], $resolution_id), array('update' => 'content', 'indicator' => 'loading','class'=>'actions'), '¿Realmente desea eliminar el registro?'); ?></td>
                
            </tr>
<?php endforeach; ?>
    </tbody>
</table>
<?php echo $this->Js->writeBuffer(); ?>
<br>
<?php echo $this->Ajax->link('Adicionar', array('controller' => 'ResolutionCorrections', 'action' => 'add', $resolution_id), array('update' => 'content', 'indicator' => 'loading','class'=>'actions')); ?>
